of the cached page fragment and the range of content to be stored on the JSP scope-JSP page.
There is only one attribute, that is, the JSP expression must be assigned a value when each cache segment is output. The TLD file maps the two custom tags to the CacheTag and DynamicTag classes, as shown below:
TLD files are contained in the Web application descriptor file (web. xml). These five files also contain an initial parameter to indicate whether the cache is available.
Understanding
= Pagecontext.application_scope;public void SetId (String id) {This.id = ID;public void Setscope (String scope) {This.scope = Jsputils.checkscope (scope);}...} The Setscope () method calls Jsputils.checkscope () to verify the property value of the scope that has been converted from string to type int.... public class Jsputils {...public static int Checkscope (String scope) {if ("page". Equalsignorecase
: / * Add a staging scope. * C language (c?) in the program block ({...} Block) will also introduce a new variable scope. * ///#@ @range/blocknode{public Void visit (blocknode node) {/ * * First Call pushscope method, Generates a scope object that stores the variables defined on this scope, and then presses into the scope stack. * /Pushscope (Node.variables ()); /* * Then execute super.visit (node), perform the processing defined in the base class visi
holds all the parameters related to oauth. // oauthsigner is responsible for signing the oauth base string. // create a googleoauthparameters instance, which contains all oauth parametergoogleoauthparameters oauthparameters = new googleoauthparameters (); oauthparamete Rs. setoauthconsumerkey (oauthconsumerkey); oauthparameters. setscope (scope); // initialize the oauth signer. if you are using RSA-SHA1, you must provide // your private key as a base
executed. SKIP_BODY;} else {// execute the label body return TagSupport. EVAL_BODY_INCLUDE;} public void setName (String name) {this. name = name;} public void setScope (String scope) {this. scope = scope ;}}
4.2 configure tags in the tag Library
4.3 use tags in jsp'
Whether to execute the label body depends on the returned value.
5. Summary
Iv. Iteration labels
1. Requirements
In the MVC mode, it is emphasized that script code should not app
Python scope, python
Before writing a scope, you must first understand the local variables and global variables. After understanding local variables and global variables, the concept of scope is well understood.
Local variable: Local variables can only be accessed locally. if they exceed the scope, they become ineffective.
Global Variables: Can be used in any scope. When the current scope has local variables with the same variable name, the local variables take effect.
(Forget to define it accur
. However, because there is a special meaning in the programming language, it cannot be used as an identifier. For example, class, public is a reserved word in Java.Resource (Resource): a data file in a picture, sound, text, or program is a resource. The Java resource file and the compiled class file are stored in the same path (class path).Robust Programs (robust program): robust programs are not only correct, they also handle errors reasonably, such as the absence of a file or the inability to
is implemented by the doScan method of ComponentScanBeanDefinitionParser. The source code is as follows:
Protected Set
DoScan (String... basePackages) {// create a queue to save BeanDefinitionHolderSet
BeanDefinitions = new LinkedHashSet
(); // Loop the package to be scanned for (String basePackage: basePackages) {// scan annotation and package it into BeanDefinitionSet
Candidates = findCandidateComponents (basePackage); for (BeanDefinition candidate: candidates
instance variables. Other IfTag, WhileTag, and ItemTag classes are not constructors. Note that the Java compiler automatically generates a public constructor without any constructor In the case that the class does not contain any constructor. This function does not perform any operations.
Step 2: Set attributesThe tag attribute values on the JSP page are passed to the tag processing class through the setAttribute () method. For example
The tag contains four attributes: var, scope, expr, an
access chtl.hkbu.edu.hk Google Apps domain user "student1@chtl.hkbu.edu.hk" string xoauthrequestorid = "student1@chtl.hkbu.edu.hk ";//!!! Append the "xoauth_requestor_id" parameter to the feed URL. This // parameter indicates which user you are loading the data for. strcalendarfeedurl + = "? Xoauth_requestor_id = "+ xoauthrequestorid; //////////////////////////////////////// /// // Step 1: set up the oauth objects /////////////////////////////////// //////////////////////////////////////// ///
1. Create a new tag named name. TLD. Note that this file should be placed under the WEB-INF file (same as Web. XML) and will be automatically loaded at runtime
2. Now we start to implement the getname method of the tag. Create a new package com. yuqiaotech. PMS. webapp. tags, which contains two files: getname. Java and pmstag. java.
Getname. Java
Package COM. yuqiaotech. PMS. webapp. tags; import javax. servlet. JSP. jspexception; public class getname extends pmstag {private string username;
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.